package net.k3rnel.abugadro.gcodes.beans;

import net.k3rnel.abugadro.AbugadroContentProvider;
import android.net.Uri;
import android.provider.BaseColumns;

public class Issue {

	public Issue() {
	}

	public static final class Issues implements BaseColumns {
		private Issues() {
		}

		public static final Uri CONTENT_URI = Uri.parse("content://"+ AbugadroContentProvider.AUTHORITY + "/gcode/*/issues");

		public static final String CONTENT_TYPE_DIR = "vnd.android.cursor.dir/vnd.abugadro.issues";
		public static final String CONTENT_TYPE_ITEM = "vnd.android.cursor.item/vnd.abugadro.issues";

		public static final String _ID = "_id";
		public static final String GCODE_ID = "gcode_id";
		public static final String ISSUE_ID = "issue_id";
		public static final String PUBLISHED = "published";
		public static final String UPDATED = "updated";
		public static final String TITLE = "title";
		public static final String CONTENT = "content";
		public static final String AUTHOR = "author";
		public static final String OWNER = "owner";
		public static final String STARS = "stars";
		public static final String STATE = "state";
		public static final String STATUS = "status";
		public static final String LABELS = "labels";
		public static final String LASTSYNC = "lastsync";
		
		public static final String DEFAULT_SORT = ISSUE_ID + " ASC";
		
		public static final String SORT_DATE = PUBLISHED + " ASC";
		public static final String SORT_DATE_DESC = PUBLISHED + " DESC";
		
		public static final String SORT_ID = ISSUE_ID + " ASC";
		public static final String SORT_ID_DESC = ISSUE_ID + " DESC";
		
		public static final String SORT_OWNER = OWNER + " ASC";
		public static final String SORT_OWNER_DESC = OWNER + " DESC";
		
		public static final String SORT_STATUS = STATUS + " ASC";
		public static final String SORT_STATUS_DESC = STATUS + " DESC";
		
		public static final String SORT_STARS = STARS + " ASC";
		public static final String SORT_STARS_DESC = STARS + " DESC";
		
		/** Build {@link Uri} for requested {@link #_ID}. */
        public static Uri buildFullUri(String gcodeId) {
        	return Uri.parse("content://"+ AbugadroContentProvider.AUTHORITY + "/gcode/"+gcodeId+"/issues");
        }
        public static Uri buildUri(String gcodeId, String issueId) {
        	return Uri.parse("content://"+ AbugadroContentProvider.AUTHORITY + "/gcode/"+gcodeId+"/issues/"+issueId);
        }
	}

}